import {createRouter,createWebHistory} from 'vue-router'
// 路由懒加载
import { defineAsyncComponent } from 'vue'
import index from '../pages/index.vue'


//（即该异步组件在页面中被渲染时）
const user = defineAsyncComponent(() => import('../pages/UserData.vue'))
const routes = [

    {
        path:'/user',component:user,
    },
    {
        path:"/",redirect: '/index', children: [
            {
              path: 'index',
              component:index
            },
          ],
    }
]
const router = createRouter({
    history:createWebHistory(),
    routes
})
export default router




